package Logic;

import microgame.toolset.datatable.DataTable;
import microgame.toolset.datatable.DataTableManager;
import microgame.toolset.datatable.Row;

import java.util.ArrayList;
import java.util.Hashtable;

public class PropCoord {
    private static PropCoord instance;
    private Hashtable<Integer, ArrayList<Point2d>> mapCoorArray = new Hashtable<>();

    public static PropCoord Instance() {
        if (instance == null) {
            instance = new PropCoord();
        }
        return new PropCoord();
    }

    public void Init() {
        DataTable table = DataTableManager.Instance().GetDataTable("map");
        ArrayList<Row> rows = table.GetAllRows();

        for (int i = 0; i < rows.size(); ++i) {
            int width = rows.get(i).GetInteger("width");
            int height = rows.get(i).GetInteger("height");
            int originx = rows.get(i).GetInteger("originx");
            int originy = rows.get(i).GetInteger("originy");

            int minx = originx - width / 2;
            int maxx = originx + width / 2;
            int miny = originy - height / 2;
            int maxy = originy + height / 2;

            int numberGridHorizontal = width / 400;
            int numberGridVertical = height / 500;

            for (int x = 0; x < numberGridHorizontal; ++x) {
                int ho = x * 400;

                for (int y = 0; y < numberGridVertical; ++y) {
                    int ver = y * 500;


                }
            }




        }

    }
}
